home *** CD-ROM | disk | FTP | other *** search
- USING PCOMMAND WITH TDI MODULA-2
- by Bob Rogers (GEnie R.C.ROGERS)
-
- The command line interpreter pcommand (a shareware product from
- Solid Applications Inc.) is an ideal replacement for TDI's
- desktop. It makes your ST look like a PC with commands like "dir"
- (for a directory listing) and gives you the ability to write batch
- files that will automate many of your programming tasks. Using
- pcommand is much faster than using the desktop and gives you more
- control over where you can put your files.
-
- I'll describe how I set up my system as an example of how pcommand
- can be used with Modula. I have a 1040 ST with one drive and the
- developers' version of Modula. I also use a 550k RAM disk
- (Charles Semton's fine public domain fastram program, which can be
- set up to be just about any size and which doesn't take an
- accessory slot). I've set up my system to minimize the time I
- spend waiting for compiles and links. Since I edit and compile
- more than I link I put the compiler, symbol files, and editor on
- RAM disk and the linker and link files on the physical drive. I
- also keep source files on the real disk -- to protect them from my
- mistakes.
-
- SET UP
-
- My Modula boot disk contains an auto folder with a time and date
- setter (autodate by Vanya Cooper - the best public domain clock
- setting program I've found) and the RAM disk which is set up as
- drive D.
-
- The boot disk also has a folder called copy2ram. This is where I
- put all the files that will be put on the RAM disk. A
- subdirectory under copy2ram, called symlib, contains all the .sym
- files that came with TDI's package. Other files in copy2ram are
- the TDI compiler, editor, modulast.ovl folder, the file
- gemaccx.lnk, pcommand, and a set of batch files I'll be describing
- latter.
-
- The root directory of the boot disk has a desktop.inf file, desk
- accessories, pcommand (under an alias, see below), a pcommand
- autoexec.bat file and the m2paths.txt file, which I've set up like
- this:
-
- D:\
- D:\SYMLIB\
- A:\
- A:\LNKLIB\
-
- I saved the desktop with the A drive's root directory displayed on
- the screen, so when boot-up is done I double-click a renamed copy
- of pcommand (I changed the name to start_up as a memory jogger).
- When it runs the following autoexec.bat file is automatically
- executed:
-
- echo off
- log off
- verify off
- copy a:\copy2ram\*.* d:
- verify on
- prompt $n:$p >
- switchar -
- path a:\
- cd a:\
- cd d:\
- d:
- cd \
-
-
- When all that's done (and it does take a while) all you have to do
- is put in your work disk and you're ready to go. The work disk
- contains the folder lnklib, which contains all the .lnk files that
- come with Modula. The other essential item on the work disk is
- the TDI linker, which has to be in the root directory to work with
- the batch files I've written.
-
-
- THE BATCH FILES
-
- These following batch files are all kept on the RAM disk for
- speed. Note that they assume a set-up like I've described above.
- Source files are referenced by drive designator (e.g. a:) only --
- this means the files can be in any subdirectory on the A drive as
- long as it is the current default for that drive (a subdirectory
- is made the default by using the cd command). All the batch files
- that call the compiler will call the editor if any errors were
- errors found. All batch files that call the editor delete the
- backup file when the editor is done.
-
- AUTOEXEC.BAT -- like the one described above, but no copy to RAM:
-
- echo off
- log off
- prompt $n:$p >
- switchar -
- path a:\
- cd a:\
- cd d:\
-
- ED.BAT -- edits and compiles .def files:
-
- rem Call editor and (optionally) compiler for file %1.def.
- rem Assumes %1.def is in a: drive's current directory.
- rem Compiler errors will restart editor.
- rem Deletes editor's backup file (%1.dez).
- :edit
- d:\editor a:%1.def
- del a:%1.dez
- input Compile (y+return or return)?
- if not %:i==y goto done
- verify off
- d:\modula a:%1.def
- verify on
- if exists a:%1.erm goto edit
- :done
-
- EM.BAT -- edits and compiles .mod files:
-
- rem Call editor and (optionally) compiler and linker for file %1.mod.
- rem Assumes %1.mod is in a: drive's current directory.
- rem Compiler errors will restart editor.
- rem Deletes editor's backup file (%1.moz).
- rem Optional desk accessory link.
- :edit
- d:\editor a:%1.mod
- del a:%1.moz
- input Compile (y+return or return)?
- if not %:i==y goto done
- verify off
- d:\modula a:%1.mod
- verify on
- if exists a:%1.erm goto edit
- input Link (y+return or return)?
- if not %:i==y goto done
- input Link as desk accessory (y+return or return)?
- if not %:i==y goto notacc
- ren d:\gemaccx.lnk d:\gemx.lnk
- a:\linker a:%1.lnk
- ren d:\gemx.lnk d:\gemaccx.lnk
- goto done
- :notacc
- a:\linker a:%1.lnk
- :done
-
- MD.BAT -- compiles .def files:
-
- rem Call compiler for file %1.def.
- rem Assumes %1.def is in a: drive's current directory.
- rem Compiler errors will start editor.
- rem Deletes editor's backup file (%1.dez).
- goto compile
- :edit
- d:\editor a:%1.def
- del a:%1.dez
- input Compile (y+return or return)?
- if not %:i==y goto done
- :compile
- verify off
- d:\modula a:%1.def
- verify on
- if exists a:%1.erm goto edit
- :done
-
- MM.BAT -- compiles .mod files:
-
- rem Call compiler and (optionally) linker for file %1.mod.
- rem Assumes %1.mod is in a: drive's current directory.
- rem Compiler errors will restart editor.
- rem Deletes editor's backup file (%1.moz).
- rem Optional desk accessory link.
- goto compile
- :edit
- d:\editor a:%1.mod
- del a:%1.moz
- input Compile (y+return or return)?
- if not %:i==y goto done
- :compile
- verify off
- d:\modula a:%1.mod
- verify on
- if exists a:%1.erm goto edit
- input Link (y+return or return)?
- if not %:i==y goto done
- input Link as desk accessory (y+return or return)?
- if not %:i==y goto notacc
- ren d:\gemaccx.lnk d:\gemx.lnk
- a:\linker a:%1.lnk
- ren d:\gemx.lnk d:\gemaccx.lnk
- goto done
- :notacc
- a:\linker a:%1.lnk
- :done
-
- L.BAT -- links .lnk files:
-
- rem Link file a:%1.lnk.
- a:\linker a:%1.lnk
-
- LA.BAT -- links .lnk files as desk accessories:
-
- rem Link file a:%1.lnk as a desk accessory.
- ren d:\gemaccx.lnk d:\gemx.lnk
- a:\linker a:%1.lnk
- ren d:\gemx.lnk d:\gemaccx.lnk
- ren a:%1.prg a:%1.acc
-
-
- AN EXAMPLE
-
- Let's say you're writing a program called "test" and that it will
- have a main module called "test" and a library module called
- "libr". You want to put all your work in the subdirectory "mydir"
- so create mydir with the pcommand command "mkdir mydir" and make
- that the current drive by typing "cd a:\mydir" at the pcommand
- prompt. First write libr.def by typing "ed libr" at the pcommand
- prompt. When there are no more compile errors write libr.mod by
- typing "em libr" at the prompt. Then write test.mod using "em
- test". When you're all done mydir will contain libr.def, libr.mod,
- libr.sym, libr.lnk, test.mod, test.lnk, and test.prg.
-